﻿<UserControl x:Class="Hisaab.Windows.Client.View.AccountSummaryView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:charting="clr-namespace:System.Windows.Controls.DataVisualization.Charting;assembly=System.Windows.Controls.DataVisualization.Toolkit"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             mc:Ignorable="d"
             d:DesignHeight="295" d:DesignWidth="732" >
    <UserControl.Resources>
    </UserControl.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition />
            <ColumnDefinition Width="6"/>
            <ColumnDefinition />
        </Grid.ColumnDefinitions>
        <Label Grid.Row="0" Grid.ColumnSpan="3" Content="{Binding Path=SelectedAccount.Name}" Height="Auto" HorizontalContentAlignment="Center" Style="{DynamicResource Heading1}" />
        <StackPanel Grid.Row="1" Grid.ColumnSpan="3" Height="Auto" Orientation="Horizontal">
            <Label Height="Auto" Content="{Binding Path=Summary.TransactionCount}" Width="Auto" HorizontalContentAlignment="Right" VerticalContentAlignment="Center" Style="{DynamicResource Heading2Simple}" />
            <Label Content="transaction(s) recorded with ending balance of" Height="Auto" Width="Auto" VerticalContentAlignment="Center" Style="{DynamicResource Heading2Simple}" />
            <Label Content="{Binding Path=Summary.EndingBalance, StringFormat='{}{0:C}'}" Height="Auto" HorizontalContentAlignment="Left" VerticalContentAlignment="Center" Width="Auto" Style="{DynamicResource Heading2Simple}" />
        </StackPanel>
        <charting:Chart  Grid.Row="2" Grid.Column="0" >
            <charting:Chart.Series>
                <charting:LineSeries Title=" Monthly Totals" ItemsSource="{Binding Path=MonthlyTotals}"
                    IndependentValueBinding="{Binding Path=Month}"
                    DependentValueBinding="{Binding Path=MonthlyTotal}" />
            </charting:Chart.Series>
        </charting:Chart>
        <GridSplitter Grid.Row="2" Grid.Column="1" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" />

        <charting:Chart  Grid.Row="2" Grid.Column="2" >
            <charting:Chart.Series>
                <charting:LineSeries Title=" Monthly Balance" ItemsSource="{Binding Path=MonthlyTotals}"
                    IndependentValueBinding="{Binding Path=Month}"
                    DependentValueBinding="{Binding Path=CumulativeTotal}">
                    <charting:LineSeries.ToolTip>
                        <StackPanel>
                            <ContentControl Content="Month" FontWeight="Bold"/>
                            <ContentControl Content="{Binding Month}"/>
                            <ContentControl Content="Balance" FontWeight="Bold"/>
                            <ContentControl Content="{Binding CumulativeTotal}"/>
                        </StackPanel>
                    </charting:LineSeries.ToolTip>
                </charting:LineSeries>
            </charting:Chart.Series>
        </charting:Chart>
    </Grid>
</UserControl>